package com.nstc.ibd.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.nstc.ibd.dao.GwmsDao;
import com.nstc.ibd.model.gwms.view.GuaranteeView;
import com.nstc.ibd.service.GwmsService;

@Service("gwmsService")
public class GwmsServiceImpl implements GwmsService{
    
    @Autowired
    private GwmsDao gwmsDao;
    
    public void saveGuarantee(List<GuaranteeView> viewList) {
        for (GuaranteeView guaranteeView : viewList) {
            gwmsDao.saveGuarantee(guaranteeView);
        }
    }
	
    public  GuaranteeView getGuarantee(String guaranteeNo) {
        return gwmsDao.getGuarantee(guaranteeNo);
    }
	
    public Boolean IsExist(String guaranteeNo) {
    	Integer count = gwmsDao.isExist(guaranteeNo);
    	if (count > 0) {
    		return true;
    	}
    	return false;
    }

}
